<template>
  <el-time-select
    ref="timeSelectRef"
    v-bind="$attrs"
    @change="(value) => emit('change', value)"
    @blur="emit('blur')"
    @focus="() => emit('focus')"
    @clear="() => emit('clear')"
  />
</template>

<script setup>
const emit = defineEmits(['change', 'blur', 'focus', 'clear', 'visible-change'])

const timeSelectRef = ref(null)

defineExpose(
  new Proxy(
    {},
    {
      get(target, key) {
        return timeSelectRef.value?.[key]
      },
      has(target, key) {
        return key in timeSelectRef.value
      },
    },
  ),
)
</script>
